package com.example.springboot.config.amqp.rabbitmq;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/1/2 23:06
 */
@Component
@RabbitListener(queuesToDeclare = @Queue(value = "czk.news"))
public class RabbitListenerDemo {
    @RabbitHandler
    public void receive(String message){
        System.out.println(message);
    }
}
